//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Runtime.InteropServices;

namespace OpenLS.UI.Interop
{
    [ComImport, CoClass(typeof (FileSaveDialogImp)),Guid("84bccd23-5fde-4cdb-aea4-af64b83d78ab"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IFileSaveDialog
    {
        [PreserveSig]
        int Show(IntPtr parent);
        
        void SetFileTypes(int cFileTypes, [MarshalAs(UnmanagedType.LPArray)]string[] rgFilterSpec);
        
        void SetFileTypeIndex(int iFileType);

        void GetFileTypeIndex(out int piFileType);
        
        void Advise([MarshalAs(UnmanagedType.Interface)] IFileDialogEvents pfde, out uint pdwCookie);
        
        void Unadvise(uint dwCookie);
        
        void SetOptions(NativeMethods.FOS fos);
        
        void GetOptions(out NativeMethods.FOS pfos);
        
        void SetDefaultFolder([MarshalAs(UnmanagedType.Interface)] IShellItem psi);

        void SetFolder([MarshalAs(UnmanagedType.Interface)] IShellItem psi);

        void GetFolder([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);

        void GetCurrentSelection([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);

        void SetFileName([MarshalAs(UnmanagedType.LPWStr)] string pszName);

        void GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
        
        void SetTitle([MarshalAs(UnmanagedType.LPWStr)] string pszTitle);
        
        void SetOkButtonLabel([MarshalAs(UnmanagedType.LPWStr)] string pszText);
        
        void SetFileNameLabel([MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
        
        void GetResult([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
        
        void AddPlace([MarshalAs(UnmanagedType.Interface)] IShellItem psi, NativeMethods.FDAP fdap);
        
        void SetDefaultExtension([MarshalAs(UnmanagedType.LPWStr)] string pszDefaultExtension);
        
        void Close([MarshalAs(UnmanagedType.Error)] int hr);
        
        void SetClientGuid(ref Guid guid);
        
        void ClearClientData();

        void SetFilter([MarshalAs(UnmanagedType.Interface)] IntPtr pFilter);

        void SetSaveAsItem([MarshalAs(UnmanagedType.Interface)] IShellItem psi);

        void SetProperties([MarshalAs(UnmanagedType.Interface)] IntPtr pStore);

        void SetCollectedProperties([MarshalAs(UnmanagedType.Interface)] IntPtr pList, int fAppendDefault);

        void GetProperties([MarshalAs(UnmanagedType.Interface)] out IntPtr ppStore);

        void ApplyProperties([MarshalAs(UnmanagedType.Interface)] IShellItem psi, [MarshalAs(UnmanagedType.Interface)] IntPtr pStore, [ComAliasName("ShellObjects.wireHWND")] ref IntPtr hwnd, [MarshalAs(UnmanagedType.Interface)] IntPtr pSink);
    }
    [ComImport, ClassInterface(ClassInterfaceType.None), Guid("C0B4E2F3-BA21-4773-8DBA-335EC946EB8B")]
    class FileSaveDialogImp
    {
    }
}
